/*
ID: icerupt1
PROG: window
LANG: C++11
*/

/* solution
 *
 * 离散化就可以做。
 *
*/
#include <fstream>
#include <iostream>
#include <algorithm>
#include <unordered_map>
#include <vector>
#include <cstring>
#include <string>
#include <iomanip>

std::ifstream fin {"window.in" };
std::ofstream fout{"window.out"};

struct window { int x, y, u, v; char l; };

std::vector<window> win;

double calc(int p)
{
	int s = (win[p].u - win[p].x) * (win[p].v - win[p].y);
	std::vector<int> dis_x;
	std::vector<int> dis_y;
	for (int i = p; i < (int)win.size(); i++) {
		dis_x.push_back(win[i].x);
		dis_x.push_back(win[i].u);
		dis_y.push_back(win[i].y);
		dis_y.push_back(win[i].v);
	}
	std::sort(dis_x.begin(), dis_x.end());
	std::sort(dis_y.begin(), dis_y.end());

	std::unordered_map<int, int> index_x;
	std::unordered_map<int, int> index_y;
	std::unordered_map<int, int> index_ix;
	std::unordered_map<int, int> index_iy;
	int ix = 0, iy = 0;
	for (auto x : dis_x)
		if (!index_x[x]) { index_x[x] = ++ix; index_ix[ix] = x; }
	for (auto y : dis_y)
		if (!index_y[y]) { index_y[y] = ++iy; index_iy[iy] = y; }

	int px = index_x[win[p].x], py = index_y[win[p].y];
	int pu = index_x[win[p].u], pv = index_y[win[p].v];
	bool cover[pu - px + 4][pv - py + 4];
	std::memset(cover, 0, sizeof(cover));
	for (int ti = p + 1; ti < (int)win.size(); ti++) {
		int tx = std::max(index_x[win[ti].x], px) - px;
		int ty = std::max(index_y[win[ti].y], py) - py;
		int tu = std::min(index_x[win[ti].u], pu) - px;
		int tv = std::min(index_y[win[ti].v], pv) - py;
		for (int i = tx; i < tu; i++)
			for (int j = ty; j < tv; j++) cover[i][j] = true;
	}

	int sc = 0;
	for (int i = 0; i < pu - px; i++)
		for (int j = 0; j < pv - py; j++)
			if (!cover[i][j]) {
				int x = i + px, y = j + py;
				sc += (index_ix[x + 1] - index_ix[x]) * (index_iy[y + 1] - index_iy[y]);
			}

	return double(sc)/double(s) * double(100);
}

int main()
{
	for (char c, label, tmp; fin >> c; ) {
		int len = win.size();
		if (c == 'w') {
			window t;
			fin >> tmp >> t.l >> tmp >> t.x >> tmp >> t.y >> tmp >> t.u
					>> tmp >> t.v >> tmp;
			win.push_back(t);
			win[len].x = std::min(t.x, t.u);
			win[len].u = std::max(t.x, t.u);
			win[len].y = std::min(t.y, t.v);
			win[len].v = std::max(t.y, t.v);
		} else {
			fin >> tmp >> label >> tmp;
			int pos = len - 1;
			for (; pos >= 0; pos--) if (win[pos].l == label) break;
			if (c == 't') {
				window tmp = win[pos];
				for (int i = pos; i < len-1; i++)
					win[i] = std::move(win[i+1]);
				win[len - 1] = std::move(tmp);
				continue;
			}
			if (c == 'b') {
				window tmp = win[pos];
				for (int i = pos; i > 0; i--)
					win[i] = std::move(win[i-1]);
				win[0] = std::move(tmp);
				continue;
			}
			if (c == 'd') {
				win.erase(win.begin() + pos);
				continue;
			}
			if (c == 's') {
				double ans = calc(pos);
				std::cout << std::fixed << std::setprecision(3) << ans << '\n';
				fout << std::fixed << std::setprecision(3) << ans << '\n';
				continue;
			}
		}
	}
}

